home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-05 / 3mhs099.zip / SEND1.BAT < prev   
DOS Batch File  |  1992-03-18  |  2KB  |  77 lines

  1. REM 3+MHS Gateway - Send a mail message to 3+Mail via CMAIL
  2.  
  3. REM Parmameter %1 required
  4. IF %1x == x GOTO Done
  5.  
  6. REM Send the message
  7. CMAIL /s %1
  8.  
  9. REM Check Errorlevels
  10. IF Errorlevel 18 GOTO Done
  11. IF Errorlevel 17 GOTO ServerNoRespond
  12. IF Errorlevel 16 GOTO Done
  13. IF Errorlevel 15 GOTO InvalidUser
  14. IF Errorlevel 14 GOTO UnregisteredUser
  15. IF Errorlevel 13 GOTO Done
  16. IF Errorlevel 12 GOTO Done
  17. IF Errorlevel 11 GOTO Done
  18. IF Errorlevel 10 GOTO Done
  19. IF Errorlevel 9 GOTO Done
  20. IF Errorlevel 8 GOTO FileNotFound
  21. IF Errorlevel 7 GOTO Done
  22. IF Errorlevel 6 GOTO ErrorOpeningFile
  23. IF Errorlevel 5 GOTO Done
  24. IF Errorlevel 4 GOTO Done
  25. IF Errorlevel 3 GOTO Done
  26. IF Errorlevel 2 GOTO Done
  27. IF Errorlevel 1 GOTO Done
  28. GOTO Success
  29.  
  30. REM Errorlevels returned by CMail (+ == Trapped by 3MHS.EXE, * = Check here)
  31. REM *0: No error
  32. REM  1: (/r oe /ra) no messages to retrieve - not an error
  33. REM  2: too many '/' parameters for this operation
  34. REM  3: unrecognized '/' parameter
  35. REM  4: duplicate '/' parameter
  36. REM  5: not used
  37. REM *6: (/s or /a) error opening message file
  38. REM  7: file name not supplied where required
  39. REM *8: message file or attachment could not be found
  40. REM  9: directory path not supplied
  41. REM  10: missing required '/' parameter
  42. REM +11: (/s or /a) too many attachments - max is 26
  43. REM +12: (/a) no recipients
  44. REM +13: (/s or /a) too many recipients - max is 60
  45. REM *14: (/s or /a) user not registered for mail service
  46. REM *15: (/s or /a) not a valid user
  47. REM  16: Miscellaneous error
  48. REM *17: server not responding
  49.  
  50. :Success
  51. REM Error 0: Successful transmission - Mark it for post-processing
  52. RENAME %1 *.OK
  53. GOTO Done
  54.  
  55. :ServerNoRespond
  56. ECHO Error 17: 'Server not responding' when sending %1 >>ERROR.17
  57. GOTO Done
  58.  
  59. :InvalidUser
  60. ECHO Error 15: 'Not a valid user' when sending %1 >>ERROR.15
  61. GOTO Done
  62.  
  63. :UnregisteredUser
  64. ECHO Error 14: 'User not registered for mail service' when sending %1 >>ERROR.14
  65. GOTO Done
  66.  
  67. :FileNotFound
  68. REM Error 8: Unsuccessful transmission - Mark it for post-processing
  69. RENAME %1 *.FNF
  70. GOTO Done
  71.  
  72. :ErrorOpeningFile
  73. ECHO Error 6: 'Error opening message file' when sending %1 >>ERROR.6
  74. GOTO Done
  75.  
  76. :Done
  77.